<?php
/*------------------------------------------------------------------------
# mod_latestnews_scroller - Latest New Scroller
# ------------------------------------------------------------------------
# author    Vsmart Extensions
# copyright Copyright (C) 2010 www.vsmart-extensions.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.vsmart-extensions.com
# Technical Support:  Forum - http://www.vsmart-extensions.com
-------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');
$document = JFactory::getDocument();
?>
<?php if($loadjquery){ ?>
<script src="<?php echo JURI::base(); ?>modules/mod_latestnews/tmpl/js/jquery.min.js"></script>
<?php } ?>
<script src="<?php echo JURI::base(); ?>modules/mod_latestnews/tmpl/js/script.js"></script>
<script type="text/javascript">
	var $jx = jQuery.noConflict();  
	$jx(document).ready(function(){
		$jx('ul.ve-latestnew').simpleSpy('<?php echo $number; ?>','4000');
		$jx('ul.ve-latestnew li').reverseOrder(); 
	});
</script>
<?php
	$css= ".ve-latestnew li{
		list-style:none;
		margin:10px 0px !important;
		height:".($height+30)."px;
		border:0px;
	}
	.ve-latestnew{
		padding:0px;
		margin:0px;
	}
	.ve-thumb{
		float:left;
		margin-right:10px;
		width:".$width."px;
		height:".$height."px;
		overflow:hidden;
		padding:2px;
		border:1px solid #ddd;
	}
	.ve-thumb a{
		display:block;
		width:".$width."px;
		height:".$height."px;
		overflow:hidden;
		border:0px;
	}
	.ve-thumb img{
		width:".$width."px;
		border:0px;
		margin-top:0px;
		border:0px solid #ff0000;
	}
	.ve-latestnew li a{
		font-weight:bold;
		list-style:none;
		border:0px;
		font-size:12px;
	}";
	$document->addStyleDeclaration($css);
?>
<ul class="ve-latestnew">
<?php foreach ($list as $item) : 
	
 ?>
	<li>
	  <?php if($showimage) { ?>
		<div class="ve-thumb">
			<a href="<?php echo $item->link; ?>">
				<?php if($item->thumb != ""){ ?>
					<?php echo $item->thumb; ?>
				<?php }else{ ?>
					<img src="<?php echo JURI::base(); ?>modules/mod_latestnews/tmpl/images/no_image.gif" alt=""/>
				<?php } ?>
			</a>
		</div>
		<?php } ?>
		<a href="<?php echo $item->link; ?>">
			<?php echo $item->text; ?></a><br />
			<?php echo $item->introtext; ?>
		<div style="clear:both;"></div>
	</li>
<?php endforeach; ?>
</ul>
<div style="display:none;"><a href="http://vsmart-extensions.com">Vsmart Extensions</a></div>
<div style="clear:both;"></div>			